<template>
	<SearchForm :columns="formColumn" @search="search" @reset="search" />
	<el-header>
		<div class="left-panel">
			<!-- <el-button icon="el-icon-download">导出</el-button> -->
			<!-- <el-button type="primary">修改开班日期</el-button> -->
		</div>
	</el-header>
	<el-main class="nopadding">
		<scTable
			ref="table"
			hidePropOrder
			tableName="studentList"
			v-bind="list"
			row-key="id"
			stripe
		>
			<!-- <el-table-column type="selection" width="50"></el-table-column> -->
			<template #type="scope">
				<el-link
					type="primary"
					:underline="false"
					:href="`#/student/info/detail/${scope.row.id}`"
					>{{ scope.row.type }}</el-link
				>
			</template>
			<template #subType="scope">
				<el-link
					type="danger"
					:underline="false"
					:href="`#/student/info/detail/${scope.row.id}`"
					>{{ scope.row.subType }}</el-link
				>
			</template>
			<template #memory="scope">
				<el-link
					type="danger"
					:underline="false"
					:href="`#/student/info/detail/${scope.row.id}`"
					>{{ scope.row.subType }}</el-link
				>
			</template>
			<!-- <el-table-column
				label="操作"
				width="160"
				fixed="right"
				align="center"
			> -->
			<!-- <template #default="scope"> -->
			<!-- <div>
						<el-button
							type="primary"
							plain
							size="small"
							@click="viewOutline(scope.row)"
							>大纲</el-button
						>
					</div> -->
			<!-- <div class="pt-10"> -->
			<!-- <el-button plain size="small" @click="stopUsing(scope.row)">名单</el-button> -->
			<!-- <el-button plain size="small"	@click="editDetail(scope.row)">排课</el-button> -->
			<!-- </div> -->
			<!-- </template> -->
			<!-- </el-table-column> -->
		</scTable>
	</el-main>
</template>

<script>
import SearchForm from "@/components/SearchForm/index.vue";
import { formColumn, column } from "./data";
import { ElMessageBox } from "element-plus";
// import ViewOutline from "../../../components/viewOutline.vue";

export default {
	components: {
		SearchForm,
		// ViewOutline,
	},
	data() {
		return {
			formColumn,
			list: {
				apiObj: this.$API.calss1.getList,
				params: {
					classType: "1",
				},
				column,
			},
		};
	},
	methods: {
		search(searchParams) {
			console.log(searchParams, 94);
			const params = Object.assign({}, this.list.params, searchParams);
			console.log(params, 96);
			this.$refs.table.reload(params);
		},
		deleteDetail(row) {
			console.log(row, "我是删除");
			ElMessageBox.confirm("确定要删除该课程?", "提示", {
				confirmButtonText: "确定",
				cancelButtonText: "取消",
				type: "warning",
			}).then(() => {});
		},
		// 查看大纲
		viewOutline(row) {
			this.$refs.ViewOutlineRef.openDialog();
		},
		stopUsing(row) {
			console.log(row, "我是名单");
			this.$router.push({
				path: "/teach/class/list",
			});
		},
		editDetail(row) {
			console.log(row, "我是排课");
			this.$router.push({
				path: "/teach/class/arrang",
			});
		},
	},
};
</script>
